<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Nginx与Zuul/Spring Cloud网关对比分析</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
        }
        .highlight-box {
            position: relative;
        }
        .highlight-box::before {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            height: 100%;
            width: 4px;
            background: linear-gradient(to bottom, #667eea, #764ba2);
        }
        .tooltip-icon {
            cursor: pointer;
            color: #667eea;
            margin-left: 5px;
        }
        .tooltip-icon:hover {
            color: #764ba2;
        }
        .comparison-icon {
            font-size: 2rem;
            color: #667eea;
            margin-bottom: 1rem;
        }
        .modal {
            transition: opacity 0.3s ease;
        }
        .modal-content {
            transition: transform 0.3s ease;
        }
        .modal-enter {
            opacity: 0;
        }
        .modal-enter .modal-content {
            transform: translateY(-20px);
        }
        .modal-leave-to {
            opacity: 0;
        }
        .modal-leave-to .modal-content {
            transform: translateY(20px);
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:py-32">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row items-center">
                <div class="md:w-1/2 mb-10 md:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">Nginx与Zuul/Spring Cloud网关深度对比</h1>
                    <p class="text-xl opacity-90 mb-8">探索现代API网关解决方案的核心差异与最佳实践</p>
                    <div class="flex flex-wrap gap-4">
                        <button class="bg-white text-indigo-700 hover:bg-gray-100 px-6 py-3 rounded-lg font-semibold transition duration-300 shadow-md">
                            <i class="fas fa-book-open mr-2"></i>阅读指南
                        </button>
                        <button class="border border-white text-white hover:bg-white hover:text-indigo-700 px-6 py-3 rounded-lg font-semibold transition duration-300">
                            <i class="fas fa-download mr-2"></i>下载PDF
                        </button>
                    </div>
                </div>
                <div class="md:w-1/2 flex justify-center">
                    <div class="relative w-full max-w-md">
                        <img src="https://cdn.nlark.com/yuque/0/2022/png/21449790/1650849777491-27b6f84d-5e78-4a70-9f00-c25065b3043a.png" 
                             alt="网关架构图" 
                             class="rounded-xl shadow-2xl border-4 border-white">
                        <div class="absolute -bottom-5 -right-5 bg-white p-3 rounded-lg shadow-lg">
                            <i class="fas fa-expand text-indigo-600 text-2xl"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Comparison Overview -->
    <section class="py-16 px-4 bg-white">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl md:text-4xl font-bold mb-4">核心差异概览</h2>
                <p class="text-gray-600 max-w-2xl mx-auto">Nginx与Zuul/Spring Cloud Gateway各有其独特优势，适用于不同的架构场景</p>
            </div>
            
            <div class="grid md:grid-cols-2 gap-10">
                <div class="bg-gray-50 p-8 rounded-xl shadow-sm card-hover">
                    <div class="flex items-center mb-6">
                        <div class="bg-indigo-100 p-3 rounded-full mr-4">
                            <i class="fas fa-server text-indigo-600 text-2xl"></i>
                        </div>
                        <h3 class="text-2xl font-semibold">Nginx</h3>
                    </div>
                    <ul class="space-y-4">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>高性能HTTP服务器和反向代理</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>擅长处理静态内容和大量并发连接</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>C语言编写，事件驱动模型</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>强大的负载均衡能力</span>
                        </li>
                    </ul>
                </div>
                
                <div class="bg-gray-50 p-8 rounded-xl shadow-sm card-hover">
                    <div class="flex items-center mb-6">
                        <div class="bg-purple-100 p-3 rounded-full mr-4">
                            <i class="fas fa-code-branch text-purple-600 text-2xl"></i>
                        </div>
                        <h3 class="text-2xl font-semibold">Zuul/Spring Cloud Gateway</h3>
                    </div>
                    <ul class="space-y-4">
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>专为微服务架构设计的API网关</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>丰富的应用层功能(认证、限流等)</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>Java编写，与Spring生态无缝集成</span>
                        </li>
                        <li class="flex items-start">
                            <i class="fas fa-check-circle text-green-500 mt-1 mr-3"></i>
                            <span>动态路由和过滤器机制</span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </section>

    <!-- Detailed Comparison -->
    <section class="py-16 px-4 bg-gray-50">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl md:text-4xl font-bold mb-4">深度对比分析</h2>
                <p class="text-gray-600 max-w-2xl mx-auto">从六个关键维度全面比较Nginx与Zuul/Spring Cloud Gateway</p>
            </div>
            
            <div class="bg-white rounded-xl shadow-sm overflow-hidden">
                <!-- 1. Design Purpose -->
                <div class="p-8 border-b border-gray-200 highlight-box">
                    <div class="flex items-start">
                        <div class="bg-indigo-600 text-white rounded-full w-10 h-10 flex items-center justify-center mr-4 flex-shrink-0">
                            <span class="font-bold">1</span>
                        </div>
                        <div>
                            <h3 class="text-2xl font-semibold mb-4">设计目标与用途</h3>
                            <div class="grid md:grid-cols-2 gap-8">
                                <div>
                                    <h4 class="font-semibold mb-3 text-indigo-700 flex items-center">
                                        <i class="fas fa-server mr-2"></i> Nginx
                                    </h4>
                                    <p class="text-gray-700">Nginx最初是作为高性能的HTTP服务器、反向代理服务器和负载均衡器而设计的。它广泛用于处理静态资源的托管、反向代理、负载均衡等任务。Nginx的设计非常轻量且高效，能够处理大量的并发连接。Nginx也可以通过配置来实现一些简单的API路由和请求转发功能，但主要侧重于网络层的功能，而非应用层的业务逻辑。</p>
                                </div>
                                <div>
                                    <h4 class="font-semibold mb-3 text-purple-700 flex items-center">
                                        <i class="fas fa-code-branch mr-2"></i> Zuul / Spring Cloud Gateway
                                    </h4>
                                    <p class="text-gray-700">Zuul是Netflix开发的一个API网关服务，主要用于微服务架构中请求的路由、过滤、安全和监控等任务。Spring Cloud Gateway是Spring官方推出的API网关解决方案，旨在取代Zuul，提供更高效、更灵活的API路由和管理功能。这些网关专注于微服务架构中的应用层功能，如认证授权、限流、熔断、动态路由、日志记录等。</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 2. Tech Stack -->
                <div class="p-8 border-b border-gray-200 highlight-box">
                    <div class="flex items-start">
                        <div class="bg-indigo-600 text-white rounded-full w-10 h-10 flex items-center justify-center mr-4 flex-shrink-0">
                            <span class="font-bold">2</span>
                        </div>
                        <div>
                            <h3 class="text-2xl font-semibold mb-4">技术栈</h3>
                            <div class="grid md:grid-cols-2 gap-8">
                                <div>
                                    <h4 class="font-semibold mb-3 text-indigo-700 flex items-center">
                                        <i class="fas fa-server mr-2"></i> Nginx
                                    </h4>
                                    <p class="text-gray-700">Nginx是用C语言编写的，性能极高，非常适合处理大量并发连接。它通常部署在网络边缘，作为反向代理和负载均衡器使用。</p>
                                </div>
                                <div>
                                    <h4 class="font-semibold mb-3 text-purple-700 flex items-center">
                                        <i class="fas fa-code-branch mr-2"></i> Zuul / Spring Cloud Gateway
                                    </h4>
                                    <p class="text-gray-700">Zuul是用Java编写的，基于Servlet规范构建；Spring Cloud Gateway则是基于Spring WebFlux和Reactive Streams构建的，具有非阻塞和响应式的特性。这些网关通常在微服务架构中的应用层，直接与业务服务进行交互。</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 3. Routing & Filtering -->
                <div class="p-8 border-b border-gray-200 highlight-box">
                    <div class="flex items-start">
                        <div class="bg-indigo-600 text-white rounded-full w-10 h-10 flex items-center justify-center mr-4 flex-shrink-0">
                            <span class="font-bold">3</span>
                        </div>
                        <div>
                            <h3 class="text-2xl font-semibold mb-4">路由和过滤功能</h3>
                            <div class="grid md:grid-cols-2 gap-8">
                                <div>
                                    <h4 class="font-semibold mb-3 text-indigo-700 flex items-center">
                                        <i class="fas fa-server mr-2"></i> Nginx
                                    </h4>
                                    <p class="text-gray-700">Nginx支持基于URL路径、主机名、请求头等的静态路由，并可以配置复杂的负载均衡策略。通过Lua脚本或第三方模块，可以扩展Nginx的功能，但不如Zuul / Spring Cloud Gateway灵活。</p>
                                </div>
                                <div>
                                    <h4 class="font-semibold mb-3 text-purple-700 flex items-center">
                                        <i class="fas fa-code-branch mr-2"></i> Zuul / Spring Cloud Gateway
                                    </h4>
                                    <p class="text-gray-700">这些网关天生支持基于各种规则的动态路由和过滤器，可以根据请求内容动态地选择目标服务。它们提供了强大的过滤功能，可以在请求进入微服务之前和响应返回客户端之前，对请求和响应进行加工处理，比如鉴权、日志、限流等。</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 4. Performance -->
                <div class="p-8 border-b border-gray-200 highlight-box">
                    <div class="flex items-start">
                        <div class="bg-indigo-600 text-white rounded-full w-10 h-10 flex items-center justify-center mr-4 flex-shrink-0">
                            <span class="font-bold">4</span>
                        </div>
                        <div>
                            <h3 class="text-2xl font-semibold mb-4">性能与扩展性</h3>
                            <div class="grid md:grid-cols-2 gap-8">
                                <div>
                                    <h4 class="font-semibold mb-3 text-indigo-700 flex items-center">
                                        <i class="fas fa-server mr-2"></i> Nginx
                                    </h4>
                                    <p class="text-gray-700">由于采用C语言编写，Nginx的性能非常高，尤其擅长处理静态内容和高并发的请求。它的事件驱动模型使其在处理大量连接时依然高效。Nginx的配置虽然强大，但相对来说不如Zuul / Spring Cloud Gateway灵活。</p>
                                </div>
                                <div>
                                    <h4 class="font-semibold mb-3 text-purple-700 flex items-center">
                                        <i class="fas fa-code-branch mr-2"></i> Zuul / Spring Cloud Gateway
                                    </h4>
                                    <p class="text-gray-700">虽然性能上比Nginx略逊一筹，但它们可以通过Java编写自定义过滤器，灵活扩展功能，且更适合微服务架构下复杂的业务场景。Spring Cloud Gateway在非阻塞和响应式方面有更好的表现，适合处理现代微服务架构中的高并发场景。</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 5. Ecosystem -->
                <div class="p-8 border-b border-gray-200 highlight-box">
                    <div class="flex items-start">
                        <div class="bg-indigo-600 text-white rounded-full w-10 h-10 flex items-center justify-center mr-4 flex-shrink-0">
                            <span class="font-bold">5</span>
                        </div>
                        <div>
                            <h3 class="text-2xl font-semibold mb-4">扩展与社区支持</h3>
                            <div class="grid md:grid-cols-2 gap-8">
                                <div>
                                    <h4 class="font-semibold mb-3 text-indigo-700 flex items-center">
                                        <i class="fas fa-server mr-2"></i> Nginx
                                    </h4>
                                    <p class="text-gray-700">Nginx拥有庞大的用户群体和丰富的插件生态系统，适用于各种网络层和应用层的需求。Nginx Plus还提供了一些增强功能，如动态配置、健康检查等。</p>
                                </div>
                                <div>
                                    <h4 class="font-semibold mb-3 text-purple-700 flex items-center">
                                        <i class="fas fa-code-branch mr-2"></i> Zuul / Spring Cloud Gateway
                                    </h4>
                                    <p class="text-gray-700">Zuul曾经是Netflix微服务架构中的核心组件，但已经逐渐被Spring Cloud Gateway取代。Spring Cloud Gateway背靠Spring社区，拥有强大的扩展能力和与Spring生态的无缝集成，适合Spring Boot/Spring Cloud项目。</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <!-- 6. Use Cases -->
                <div class="p-8 highlight-box">
                    <div class="flex items-start">
                        <div class="bg-indigo-600 text-white rounded-full w-10 h-10 flex items-center justify-center mr-4 flex-shrink-0">
                            <span class="font-bold">6</span>
                        </div>
                        <div>
                            <h3 class="text-2xl font-semibold mb-4">使用场景</h3>
                            <div class="grid md:grid-cols-2 gap-8">
                                <div>
                                    <h4 class="font-semibold mb-3 text-indigo-700 flex items-center">
                                        <i class="fas fa-server mr-2"></i> Nginx
                                    </h4>
                                    <p class="text-gray-700">适合需要处理大量静态内容、简单的反向代理和负载均衡的场景。通常用于微服务架构中的前置代理，负责将请求转发到内部的Zuul / Spring Cloud Gateway或直接到微服务。</p>
                                </div>
                                <div>
                                    <h4 class="font-semibold mb-3 text-purple-700 flex items-center">
                                        <i class="fas fa-code-branch mr-2"></i> Zuul / Spring Cloud Gateway
                                    </h4>
                                    <p class="text-gray-700">适合微服务架构中的API网关，提供丰富的应用层功能，如认证、授权、动态路由、限流、监控等。可以与Nginx搭配使用，Nginx作为外层的反向代理，Zuul / Spring Cloud Gateway处理应用层逻辑。</p>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Architecture Diagram -->
    <section class="py-16 px-4 bg-white">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl md:text-4xl font-bold mb-4">架构关系图</h2>
                <p class="text-gray-600 max-w-2xl mx-auto">展示Nginx与Spring Cloud Gateway在微服务架构中的典型部署模式</p>
            </div>
            
            <div class="bg-gray-50 rounded-xl p-8">
                <div class="mermaid">
                    graph TD
                    A[客户端] -->|请求| B[Nginx]
                    B -->|代理/负载均衡| C[Spring Cloud Gateway]
                    C --> D[用户服务]
                    C --> E[订单服务]
                    C --> F[支付服务]
                    style A fill:#f5f5f5,stroke:#333,stroke-width:2px
                    style B fill:#c7d2fe,stroke:#4f46e5,stroke-width:2px
                    style C fill:#e9d5ff,stroke:#9333ea,stroke-width:2px
                    style D fill:#f0fdf4,stroke:#16a34a,stroke-width:2px
                    style E fill:#eff6ff,stroke:#2563eb,stroke-width:2px
                    style F fill:#fef2f2,stroke:#dc2626,stroke-width:2px
                </div>
                
                <div class="mt-8 grid md:grid-cols-3 gap-6">
                    <div class="bg-white p-6 rounded-lg shadow-sm border-l-4 border-indigo-500">
                        <h3 class="font-semibold text-lg mb-3">Nginx层</h3>
                        <p class="text-gray-700">作为边缘服务，处理SSL终止、静态内容分发、基础路由和负载均衡</p>
                    </div>
                    <div class="bg-white p-6 rounded-lg shadow-sm border-l-4 border-purple-500">
                        <h3 class="font-semibold text-lg mb-3">API网关层</h3>
                        <p class="text-gray-700">处理应用层逻辑：认证授权、动态路由、请求转换、API聚合等</p>
                    </div>
                    <div class="bg-white p-6 rounded-lg shadow-sm border-l-4 border-green-500">
                        <h3 class="font-semibold text-lg mb-3">微服务层</h3>
                        <p class="text-gray-700">专注于业务逻辑实现，通过网关暴露API，实现服务自治</p>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Decision Guide -->
    <section class="py-16 px-4 bg-indigo-50">
        <div class="container mx-auto max-w-6xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl md:text-4xl font-bold mb-4">技术选型指南</h2>
                <p class="text-gray-700 max-w-2xl mx-auto">根据您的具体需求选择合适的网关解决方案</p>
            </div>
            
            <div class="bg-white rounded-xl shadow-sm overflow-hidden">
                <div class="grid md:grid-cols-2 divide-x divide-gray-200">
                    <div class="p-8">
                        <div class="flex items-center mb-6">
                            <div class="bg-indigo-100 p-3 rounded-full mr-4">
                                <i class="fas fa-server text-indigo-600 text-2xl"></i>
                            </div>
                            <h3 class="text-2xl font-semibold">选择Nginx的场景</h3>
                        </div>
                        <ul class="space-y-4">
                            <li class="flex items-start">
                                <i class="fas fa-check text-indigo-500 mt-1 mr-3"></i>
                                <span>需要处理大量静态内容和高并发请求</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-indigo-500 mt-1 mr-3"></i>
                                <span>主要需求是反向代理和负载均衡</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-indigo-500 mt-1 mr-3"></i>
                                <span>需要极高的性能和资源效率</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-indigo-500 mt-1 mr-3"></i>
                                <span>网络层功能需求为主，应用层逻辑简单</span>
                            </li>
                        </ul>
                    </div>
                    
                    <div class="p-8">
                        <div class="flex items-center mb-6">
                            <div class="bg-purple-100 p-3 rounded-full mr-4">
                                <i class="fas fa-code-branch text-purple-600 text-2xl"></i>
                            </div>
                            <h3 class="text-2xl font-semibold">选择Spring Cloud Gateway的场景</h3>
                        </div>
                        <ul class="space-y-4">
                            <li class="flex items-start">
                                <i class="fas fa-check text-purple-500 mt-1 mr-3"></i>
                                <span>基于Spring Cloud的微服务架构</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-purple-500 mt-1 mr-3"></i>
                                <span>需要复杂的应用层逻辑处理</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-purple-500 mt-1 mr-3"></i>
                                <span>需要动态路由、API聚合等高级功能</span>
                            </li>
                            <li class="flex items-start">
                                <i class="fas fa-check text-purple-500 mt-1 mr-3"></i>
                                <span>需要与Spring Security等组件深度集成</span>
                            </li>
                        </ul>
                    </div>
                </div>
                
                <div class="p-8 bg-gray-50 border-t border-gray-200">
                    <h3 class="text-xl font-semibold mb-4">混合部署建议</h3>
                    <p class="text-gray-700 mb-6">在实际生产环境中，Nginx和Spring Cloud Gateway可以协同工作，各自发挥优势：</p>
                    <div class="bg-white p-6 rounded-lg border border-gray-200">
                        <div class="flex items-start">
                            <i class="fas fa-lightbulb text-yellow-500 text-2xl mr-4 mt-1"></i>
                            <div>
                                <p class="font-medium mb-2">推荐架构：Nginx(边缘) + Spring Cloud Gateway(应用层)</p>
                                <p class="text-gray-700">Nginx作为第一道防线，处理SSL、静态内容、基础路由和DDoS防护；Spring Cloud Gateway专注于微服务特有的应用层功能，如认证、限流、熔断等。</p>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- FAQ -->
    <section class="py-16 px-4 bg-white">
        <div class="container mx-auto max-w-4xl">
            <div class="text-center mb-16">
                <h2 class="text-3xl md:text-4xl font-bold mb-4">常见问题解答</h2>
                <p class="text-gray-600 max-w-2xl mx-auto">关于Nginx和API网关的典型疑问</p>
            </div>
            
            <div class="space-y-6">
                <div class="bg-gray-50 rounded-xl p-6 card-hover">
                    <div class="flex items-start">
                        <div class="bg-indigo-100 p-3 rounded-full mr-4 flex-shrink-0">
                            <i class="fas fa-question text-indigo-600"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-2">Nginx能完全替代API网关吗？</h3>
                            <p class="text-gray-700">虽然Nginx可以通过扩展实现部分API网关功能，但对于复杂的微服务场景，它无法完全替代专门的API网关。Nginx更擅长网络层功能，而API网关专注于应用层逻辑，两者定位不同。</p>
                        </div>
                    </div>
                </div>
                
                <div class="bg-gray-50 rounded-xl p-6 card-hover">
                    <div class="flex items-start">
                        <div class="bg-purple-100 p-3 rounded-full mr-4 flex-shrink-0">
                            <i class="fas fa-question text-purple-600"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-2">Spring Cloud Gateway相比Zuul有哪些优势？</h3>
                            <p class="text-gray-700">Spring Cloud Gateway基于响应式编程模型(WebFlux)，性能更高；提供更灵活的路由定义方式；与Spring生态系统集成更紧密；支持更现代的编程范式；Netflix已停止Zuul的演进，Spring官方推荐使用Spring Cloud Gateway。</p>
                        </div>
                    </div>
                </div>
                
                <div class="bg-gray-50 rounded-xl p-6 card-hover">
                    <div class="flex items-start">
                        <div class="bg-indigo-100 p-3 rounded-full mr-4 flex-shrink-0">
                            <i class="fas fa-question text-indigo-600"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-2">何时应该同时使用Nginx和API网关？</h3>
                            <p class="text-gray-700">在大型分布式系统中，通常建议同时使用：Nginx作为边缘网关处理基础设施层面的功能(SSL、负载均衡、缓存等)；API网关处理业务层面的功能(认证、授权、业务路由等)。这种分层架构既能保证性能，又能满足业务灵活性需求。</p>
                        </div>
                    </div>
                </div>
                
                <div class="bg-gray-50 rounded-xl p-6 card-hover">
                    <div class="flex items-start">
                        <div class="bg-purple-100 p-3 rounded-full mr-4 flex-shrink-0">
                            <i class="fas fa-question text-purple-600"></i>
                        </div>
                        <div>
                            <h3 class="text-xl font-semibold mb-2">API网关会影响系统性能吗？</h3>
                            <p class="text-gray-700">任何中间层都会引入一定的延迟，但现代API网关(如Spring Cloud Gateway)采用非阻塞IO模型，性能影响已降到最低。合理的架构设计(如适当缓存、异步处理)可以确保网关不会成为性能瓶颈。网关提供的安全性和可观测性收益通常远大于其性能开销。</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

    <!-- Call to Action -->
    <section class="py-20 px-4 hero-gradient text-white">
        <div class="container mx-auto max-w-4xl text-center">
            <h2 class="text-3xl md:text-4xl font-bold mb-6">准备好优化您的API架构了吗？</h2>
            <p class="text-xl opacity-90 mb-8 max-w-2xl mx-auto">无论您需要高性能的负载均衡还是灵活的API管理，正确的网关选择都能显著提升您的系统表现</p>
            <div class="flex flex-wrap justify-center gap-4">
                <button class="bg-white text-indigo-700 hover:bg-gray-100 px-8 py-4 rounded-lg font-semibold text-lg transition duration-300 shadow-lg">
                    <i class="fas fa-book mr-2"></i>获取完整技术白皮书
                </button>
                <button class="border-2 border-white text-white hover:bg-white hover:text-indigo-700 px-8 py-4 rounded-lg font-semibold text-lg transition duration-300">
                    <i class="fas fa-headset mr-2"></i>咨询架构专家
                </button>
            </div>
        </div>
    </section>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-12 px-4">
        <div class="container mx-auto max-w-6xl">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-6 md:mb-0">
                    <h3 class="text-white text-2xl font-semibold mb-2">技术小馆</h3>
                    <p class="text-gray-400">专业的架构设计与技术分享平台</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-gray-300 hover:text-white transition duration-300 flex items-center">
                        <i class="fas fa-globe mr-2"></i> http://www.yuque.com/jtostring
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-500 text-sm">
                <p>© 2023 技术小馆. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
        
        // Smooth scroll for anchor links
        document.querySelectorAll('a[href^="#"]').forEach(anchor => {
            anchor.addEventListener('click', function (e) {
                e.preventDefault();
                document.querySelector(this.getAttribute('href')).scrollIntoView({
                    behavior: 'smooth'
                });
            });
        });
        
        // Simple hover effect enhancement
        document.querySelectorAll('.card-hover').forEach(card => {
            card.addEventListener('mouseenter', function() {
                this.style.boxShadow = '0 15px 30px rgba(0,0,0,0.12)';
            });
            card.addEventListener('mouseleave', function() {
                this.style.boxShadow = '';
            });
        });
    </script>
</body>
</html>